//
//  DAUModel.m
//  DAU-iOS
//
//  Created by XiangDongMBP on 2016/11/19.
//  Copyright © 2016年 East. All rights reserved.
//

#import "DAUModel.h"

#pragma mark - 机房列表
@implementation DAUEngineRoomItem
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"collectorId"  : @"id"};
}
@end

@implementation DAUEngineRoomModel
+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"result" : [DAUEngineRoomItem class]};
}
- (void)addMoreWithData:(DAUEngineRoomModel *)data {
    self.errCode = data.errCode;
    self.msg = data.msg;
    [self.result addObjectsFromArray:data.result];
}
@end


#pragma mark - 具体机房采集器信息
CGFloat const DAUModelContactValueBaseMul = 10.0;   // 服务器传过来的温度值默认放大了10倍

@implementation DAUColContactItem
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"contactId"  : @"id"};
}
@end

@implementation DAUColPowerModel
@end

@implementation DAUCollectorInfoModel
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"collectorId" : @"id",
             @"tempUpper"   : @"temperature_secure_line_upper",
             @"tempLower"   : @"temperature_secure_line_lower"};
}
+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"contact" : [DAUColContactItem class],
             @"control_contact" : [DAUColContactItem class],
             @"temperature" : [DAUColContactItem class]};
}
- (NSMutableArray<NSNumber *> *)controlContactRequestArray {
    NSMutableArray *mArray = [NSMutableArray arrayWithCapacity:self.control_contact.count];
    [self.control_contact enumerateObjectsUsingBlock:^(DAUColContactItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [mArray addObject:@(obj.value)];
    }];
    return mArray;
}
@end

@implementation DAUEngineDetailModel
@end

#pragma mark - 总的数据模型
@implementation DAUModel

@end
